Utilities to parse and process substrate metadata. Can also be enabled in
gekko
with the "metadata"
feature.
Example
use gekko_metadata::*;
// Parse runtime metadata
let content = std::fs::read_to_string("metadata_kusama_9080.hex").unwrap();
let data = parse_hex_metadata(content).unwrap().into_inner();
// Get information about the extrinsic.
let extr = data
.find_module_extrinsic("Balances", "transfer_keep_alive")
.unwrap();
assert_eq!(extr.module_id, 4);
assert_eq!(extr.dispatch_id, 3);
assert_eq!(
extr.args,
vec![
("dest", "<T::Lookup as StaticLookup>::Source"),
("value", "Compact<T::Balance>"),
]
);